﻿<?php
//Pear & Propel Stuffs
set_include_path(get_include_path() .PATH_SEPARATOR. "../../../libs/pear");
set_include_path(get_include_path() .PATH_SEPARATOR. "../../../libs/propel/runtime/lib");
set_include_path(get_include_path() .PATH_SEPARATOR. "../../../bdd/build/classes");
require_once '../../../libs/propel/runtime/lib/Propel.php';
Propel::init("../../../bdd/build/conf/tshirtfactory-conf.php");

//Get Disponibility
$d = DisponibiliteQuery::create()->filterByShirtId($_GET['id'])->filterByCouleur($_GET['color'])->filterBySexe($_GET['sex'])->filterByTaille($_GET['size'])->findOne();

$stock = 0;
if($d != null)
	$stock = $d->getQuantite();
echo $stock;